package com.gitee.wsl.model.process.response

import com.gitee.wsl.flowing.pipeline.Pipeline
import com.gitee.wsl.flowing.pipeline.PipelinePhase
import com.gitee.wsl.model.process.call.ProcessClientCall


/**
 * [HttpClient] Pipeline used for executing [ProcessResponse].
 */
class ResponsePipeline(
    override val developmentMode: Boolean = true
) : Pipeline<ResponseContainer, ProcessClientCall>(
    Receive,
    Parse,
    Transform,
    State,
    After
) {
     companion object Phases {
        /**
         * The earliest phase that happens before any other
         */
         val Receive: PipelinePhase = PipelinePhase("Receive")

        /**
         * Decode response body
         */
         val Parse: PipelinePhase = PipelinePhase("Parse")

        /**
         * Transform response body to expected format
         */
         val Transform: PipelinePhase = PipelinePhase("Transform")

        /**
         * Use this phase to store request shared state
         */
         val State: PipelinePhase = PipelinePhase("State")

        /**
         * Latest response pipeline phase
         */
         val After: PipelinePhase = PipelinePhase("After")
    }
}

